﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using Models;
using Services;


namespace WebApp.Controllers
{
    public class moviesController : Controller
    {
        ContentsServices contentSvrs = new ContentsServices();

        // GET: movies
        public ActionResult Index(int? id)
        {
            int index = id.HasValue ? id.Value : 1;
            //if (index > 1) //是首页
            //{
            //    ViewBag.PervPage = (index > 1 ? (index - 1).ToString() : "1");
            //    ViewBag.NextPage = (index > 1 ? (index + 1).ToString() : "2");
            //}
            //else
            //{
            //    ViewBag.PervPage = "1";
            //    ViewBag.NextPage = "2";
            //}

            ViewBag.Title = "最新更新";
            ContentList list = new ContentList();
            Pagination page = new Pagination();
            page.Index = index;
            page.Count = 15;
            list.List = contentSvrs.GetTopList(page);
            list.Page = page;
            return View(list);
        }

    }
}
